import http from '@/api/http.js';

//登录
//传入参数code
export const login = (code) => {
  return http.post('/login', {
    code
  });
};
//获取用户信息
export const getUser = () => {
  return http.get('/wechat/user/getdata')
}
//修改用户信息
export const updateUser = (userInfo) => {
  console.log(userInfo)
  return http.put('/wechat/user', userInfo)
}
//问答历史查询及搜索
export const QAHistory = (params) => {
  console.log(params)
  return http.get('/v1/gethistory', params)
}
//我的收藏查询及搜索
export const collection = (params) => {
  console.log(params)
  return http.get('/v1/getfavorite', params)
}
// 浏览历史查询及搜素
export const history = (params) => {
  console.log(params)
  return http.get('/v1/gethistory', params)
}
//最新政策查询
export const newPolicy = (params) => {
  console.log(params)
  return http.get(`/wechat/policy/${params.id}`)
}
//隐私政策
export const privacyPolicy = (protocolType) => {
  console.log(protocolType)
  return http.get(`/wechat/protocol/selectByType/${protocolType}`)
}
//免责声明
export const disclaimer = (disclaimer) => {
  console.log(disclaimer)
  return http.get(`/wechat/protocol/selectByType/${disclaimer}`)
}